//
//  PageCollectionView.m
//  TravelFollowYourHeart
//
//  Created by 鲁万玺 on 2017/12/14.
//  Copyright © 2017年 Lwx. All rights reserved.
//

#import "PageCollectionView.h"


@implementation PageCollectionView

- (NSMutableArray *)tableDataArr
{
    if (!_tableDataArr) {
        _tableDataArr = [NSMutableArray array];
    }
    return _tableDataArr;
}

- (void)setMJHeadRefresh:(PageCollectionViewRefreshingBlock)refreshingBlock
{
    WS(ws)
    self.mj_header = [MJRefreshNormalHeader headerWithRefreshingBlock:^{
        ws.page = 1;
        [ws.tableDataArr removeAllObjects];
        refreshingBlock();
    }];
    [self.mj_header beginRefreshing];
}

- (void)setMJFootRefresh:(PageCollectionViewRefreshingBlock)refreshingBlock
{
    WS(ws)
    self.mj_footer = [MJRefreshBackNormalFooter footerWithRefreshingBlock:^{
        ws.page++;
        refreshingBlock();
    }];
}

- (void)stopRefresh
{
    [self.mj_header endRefreshing];
    [self.mj_footer endRefreshing];
}

@end
